package com.auxgroup.smarthome.openapi.responsebody;

import java.util.Arrays;
import java.util.List;

/**
 * 设备分享功能
 * @Author: laiqiuhua.
 * @Date: 2017/7/28 10:03.
 */
public class BindAndUnbindStatus extends AbstractErrorBody {
    private String[] success;
    private String[] failed;
    private Object detail;

    public String[] getSuccess() {
        return success;
    }

    public void setSuccess(String[] success) {
        this.success = success;
    }

    public String[] getFailed() {
        return failed;
    }

    public void setFailed(String[] failed) {
        this.failed = failed;
    }

    public Object getDetail() {
        return detail;
    }

    public void setDetail(Object detail) {
        this.detail = detail;
    }

    public boolean judgeSuccess(String did){
        if (success==null || success.length==0){
            return false;
        }
        List<String> successList = Arrays.asList(success);
        return successList.contains(did);

    }

    public boolean judgeFailed(String did){
        if (failed == null || failed.length==0){
            return false;
        }
        List<String> failedlist = Arrays.asList(failed);
        return failedlist.contains(did);
    }

}
